<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <title>Document</title>

</head>

<body>

    <script>

        var[a,b]=["yuan","lei"];

        console.log(a);

        //数组的解构赋值。

        var {c,d}={c:"yuan",d:"lei"};

        console.log(d);

        [a,b]=[b,a];

        console.log(a);

        let {length:chang}="yuanlei";

        console.log(chang);

        let {e:f}={e:"jiegou",m:"fuzhi"};

        //e:f就是f是e的名字，以后访问f，而不能访问e

        console.log(f);

    </script>

</body>

</html>